/**
 * 
 */
package com.zhaokuo.dao;

import java.io.Serializable;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;

import com.zhaokuo.config.AbstractDao;
import com.zhaokuo.model.Model;

/**
 * @author zk 2012-3-19
 * 
 */
public abstract class MasterAbstractDao<T extends Model, PK extends Serializable>
		extends AbstractDao<T, PK> implements MasterDao<T, PK> {

	private SqlSession sqlSession;
	private SqlSessionFactory sqlSessionFactory;

	@Resource(name = "sqlSession")
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSession = sqlSessionTemplate;
	}

	@Resource(name = "sqlSessionFactory")
	public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
		this.sqlSessionFactory = sqlSessionFactory;
	}

	@Override
	protected SqlSession callSqlsession() {
		return sqlSession;
	}

	@Override
	protected SqlSessionFactory callSqlsessionFactory() {
		return sqlSessionFactory;
	}

	
}
